home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / bin / eatmydata < prev    next >
Encoding:
Text File  |  2011-02-19  |  1.3 KB  |  50 lines

  1. #!/bin/sh
  2.  
  3. # Copyright ┬⌐: 2010, Modestas Vainius <modax@debian.org>
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program.  If not, see <http://www.gnu.org/licenses/>.
  17.  
  18. shlib="/usr/share/libeatmydata/eatmydata.sh"
  19. if [ -f "$shlib" ]; then
  20.     . "$shlib"
  21. else
  22.     echo "Unable to locale eatmydata shell library, it was not enabled" >&2
  23.     exec "$@"
  24. fi
  25.  
  26. usage()
  27. {
  28.     echo "usage: $0 [--] command [ command arguments ... ]" >&2
  29.     exit 2
  30. }
  31.  
  32. # Detect operation mode. If this script is run via symlink, look for basename
  33. # in the PATH and execute it.
  34. if [ -L "$0" ]; then
  35.     # Symlink mode. Get command to execute from the basename of $0.
  36.     cmd="`basename "$0"`"
  37.     set -- "$cmd" "$@"
  38. else
  39.     # Normal mode
  40.     if [ "$1" = "--" ]; then
  41.         shift
  42.     fi
  43.  
  44.     if [ "$#" -eq 0 ]; then
  45.         usage
  46.     fi
  47. fi
  48.  
  49. eatmydata_exec "$@"
  50.